package main 

import (
	"fmt"
)

//go 数组
func main(){

	a1:=10.09
	a2:=12.2
	a3:=11.2

	total:=a1+a2+a3
	//avg:=total/3

	avg:= fmt.Sprintf("%.2f",total/3)

	fmt.Println("totoal=",total)
	fmt.Println("avg=",avg)

	var s [3]float64
	s[0]=10.22
	s[1]=22.22
	s[2]=32.3

	total1:=0.0
	for i:=0;i<len(s);i++{
		total1+=s[i]
	}
	avg=fmt.Sprintf("%.2f",total1/float64(len(s)))
	fmt.Println("total2=",total1)
	fmt.Println("avg2=",avg)

}